<% if mobile? %>

<div class="mobile-designer-index">
    <div class="banner">
        <img src="<%= image_path('jiazhuang-bg.png') %>" alt="">
        <div class="content">
            <h1>阳毅门窗</h1>
            <h2>设计师招募令</h2>
        </div>
    </div>

    <div class="activities">
      <a class="title" href="/design_promotions">
        <h1>
          <div class="pull-right">
            <i class="fa fa-angle-right"></i>
          </div>
          设计师活动
        </h1>
      </a>
      <div class="list">
            <% @promotions.each do |promotion| %>
                <a class="item" href="<%= design_promotion_path(promotion) %>">
                    <img src="<%= promotion.main_img %>" alt="<%= promotion.title %>">
                    <h1><%= promotion.title %></h1>
                </a>
            <% end %>
      </div>
    </div>

    <div class="designers">
        <h1 class="title">
            签约设计师
        </h1>
        <div class="list">
            <% @designers.each do |designer| %>
              <a class="item" href="<%= designer_path designer %>">
                  <%= get_designer_avatar(designer) %>
                  <h1><%= designer.name %></h1>
                  <h2><%= designer.position %></h2>
              </a>
            <% end %>
        </div>
    </div>
</div>

<% else %>

  <section class="designers-index">
      <div class="banner">
          <img src="<%= image_path('jiazhuang-bg.png') %>" alt="">
          <div class="container">
              <div class="suspension">
                  <h1>
                      <span>阳毅门窗</span> 设计师招募令
                  </h1>
                  <p>
                      如果你是个唯心主义者，喜欢发现美的事物，
                      <br> 喜欢创造完美价值，喜欢自己的作品
                      <br> 如果你正在寻找一个能够展示自己及作品，大品牌
                      <br> 高品质的平台，拓展自己的影响力
                      <br> 那就来阳毅官方商城吧...
                  </p>
                  <% if can_register_designer? %>
                    <%= link_to  "申请入驻", new_designer_path, class: 'join-btn' %>
                  <% end %>
              </div>
          </div>
      </div>

      <div class="container">
          <div class="row margin-reset advantage">
              <div class="col-xs-9 left">
                  <div class="item text-center">
                      <i class="fa fa-eercast"></i>
                      <h1>领导品牌 国际认证</h1>
                  </div>
                  <div class="item text-center">
                      <i class="fa fa-eercast"></i>
                      <h1>服务网点多 实力雄厚</h1>
                  </div>
                  <div class="item text-center">
                      <i class="fa fa-eercast"></i>
                      <h1>绿色环保 加工工艺</h1>
                  </div>
                  <div class="item text-center">
                      <i class="fa fa-eercast"></i>
                      <h1>5年质保</h1>
                  </div>
              </div>
              <div class="col-xs-3 right">
                  <% if can_register_designer? %>
                      <%= link_to  "申请入驻", new_designer_path, class: 'join-btn' %>
                      <p class="join-tip">
                          点击申请入驻阳毅官方商城
                      </p>
                  <% end %>
                  <p>在这里重新出发</p>
              </div>
          </div>
      </div>

      <div class="activities">
          <div class="container">
              <h1 class="title text-center">
                  设计师活动
                  <br>
                  <small>
                      DESIGNER ACTIVITIES
                  </small>
              </h1>

              <div class="row">
                <% @promotions.each do |promotion| %>
                  <div class="col-xs-6 item">
                      <a href="<%= design_promotion_path(promotion) %>">
                          <img src="<%= promotion.main_img %>" alt="<%= promotion.title %>">
                      </a>
                      <div class="item-info">
                          <a href="<%= design_promotion_path(promotion) %>">
                              <h1><%= promotion.title %></h1>
                          </a>
                          <p><%= strip_tags(promotion.content).truncate(200) %></p>
                          <div class="time"><%= promotion.publish_time.to_s(:db) %></div>
                      </div>
                  </div>
                  <% end %>
              </div>

              <div class="row margin-reset text-center more">
                  <a href="<%= design_promotions_path %>">
                      查看更多活动
                      <i class="fa fa-angle-double-right"></i>
                  </a>
              </div>
          </div>
      </div>

      <div class="container carousl">
          <h1 class="text-center title">
              签约设计师
              <br>
              <small>CONTRACT DESIGNER</small>
          </h1>

          <designer-carousel></designer-carousel>
      </div>
  </section>

<% end %>
